<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>javascript</title>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box
    }
    body {
      font-size: 14px;
      padding: 20px;
    }
    ul li {
      line-height: 30px;
    }
  </style>
</head>
<body>
  <ul>
    <li>1212</li>
    <div id="app"></div>
    <img src="http://wwww.baidu.com" alt="error" title="img">
  </ul>
</body>
<script src="https://cdn.bootcss.com/vue/2.6.8/vue.js"></script>
<script type="text/javascript">
    window.onload = function() {
        console.log(1)
    }
    document.addEventListener('DOMContentLoaded', function(){
        console.log(3)
    }, false)
    // 严格模式下为申明的变量不能被赋值
    // 严格模式下不能使用with
    // 严格模式下不能使用delete删除没有的属性
    // 严格模式下对象不能有相同的属性名
    // 严格模式下函数直接调用this指向undefined
    // 严格模式下不在支持arguments.callee，非严格模式下指向函数本身 
     function abc() {
     }
     abc()
     var foo = {}, F = function(){}
     Object.prototype.a = 'value a'
     Function.prototype.b = 'value b'
     console.log(foo.a) // value a
     console.log(foo.b) // undefined
     console.log(F.a)   // value a 
     console.log(Function instanceof Object)
     console.log(Object instanceof Function)
     console.dir(Object)
     console.dir(Object.__proto__ === Function.prototype)
     console.log(Array.isArray([]))
     function deep(i) { 
      if (i > 0) {
        i--
        deep(i)
      }
      console.log('11', i)
     }
     deep(4)
     setTimeout(function(){
        console.log('4定时器开始啦')
    });

    new Promise(function(resolve){
        console.log('1马上执行for循环啦');
        for(var i = 0; i < 10000; i++){
            i == 99 && resolve();
        }
    }).then(function(){
        console.log('3执行then函数啦')
    });
    console.log('2代码执行结束');
</script>
</html>